OTInetGetInterfaceInfo
Returns internet address information about the local host.C INTERFACE
OSStatus OTInetGetInterfaceInfo (InetInterfaceInfo *info, SInt32 val);C++ INTERFACE
None. C++ clients use the C interface to this function.PARAMETERS
info
- A pointer to an
InetInterfaceInfo
structure. You must allocate this structure. The function fills in such information as the internet address, subnet mask, broadcast address, MTU, and DNS address for the internet interface indicated by theindex
parameter.val
- An index into the local host's array of configured IP interfaces. Specify 0 for information about the first interface. Specify
kDefaultInetInterface
to get information about the primary interface.DESCRIPTION
Because the architecture of Open Transport TCP/IP provides for multihoming, in principle a given host can receive packets simultaneously through more than one network interface. For each IP interface configured for the local host, theOTInetGetInterfaceInfo
function provides the internet address and subnet mask, a default gateway (that is, a gateway, if any exists, that can be used to route any packet to all destinations outside the locally connected subnet), and a domain name server, if any is known. The function also returns the version number of theOTInetGetInterfaceInfo
function and, if available, the broadcast address for each interface. If the broadcast address is not available, you can determine it from the internet address and subnet mask.
- Note
- Because multihoming has not been implemented
in the initial release of Open Transport, theOTInetGetInterfaceInfo
function never returns information for more than one interface.![]()
SPECIAL CONSIDERATIONS
If Open Transport TCP/IP has not yet been loaded into memory, theOTInetGetInterfaceInfo
function returns no valid interfaces. Open Transport TCP/IP is not loaded until a TCP/IP application is running unless the user has selected "TCP always loaded" in the TCP/IP control panel.The
OTInetGetInterfaceInfo
function cannot block and always runs synchronously.SEE ALSO
TheInetInterfaceInfo
structure is described in "Internet Interface Information Structure" on page 8-25.See "OTBind" on page 8-15 for information on binding an endpoint to all configured IP interfaces.